package com.example.librarysystem.Dao;

import com.example.librarysystem.entity.Books;
import org.mapstruct.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;

@Component("booksDao")
public interface BooksDao {
    Integer selectCount();
    Integer selectScoreByName(String name);
    List<Books> selectAll(int currentPage, int pageSize);
    List<Books> selectAllByLimit(int currentPage, int pageSize);
    List<Books> selectAllByClassification(String c, int currentPage, int pageSize);
    List<Books> selectByISBN1(String ISBN);
    List<Books> selectByISBN(String ISBN, int currentPage, int pageSize);
    List<Books> selectByName(String name, int currentPage, int pageSize);
    List<Books> selectByPublishingHouse(String publishingHouse, int currentPage, int pageSize);
    List<Books> selectByPublishDate(String publishDate, int currentPage, int pageSize);
    List<Books> selectByAuthor(String author, int currentPage, int pageSize);
    List<Books> selectBySameBorrower(String bookName);
    List<Books> selectBySameStar(String bookName);
    List<Books> selectByScoreDesc(int currentPage, int pageSize);
    List<Books> selectBookByClickDesc(int currentPage, int pageSize);
    List<Books> selectBookBySearchDesc(int currentPage, int pageSize);
    List<Books> selectBookByBorrowDesc(int currentPage, int pageSize);
    List<Books> selectBookByStarDesc(int currentPage, int pageSize);
    Books selectById(int id);
    Books selectByNameOnly(String name);
    void updateBookBorrow(int id, boolean borrown);
    void updateScoreByName(int score, String name);
    void updateById(Books books);
    int insertBook(Books books);
    void deleteById(int id);
}
